<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                template="#{webContext.skin0Culomns}"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core">

    <ui:define name="center">
        #{secureGroupShow.init(param["p1"])}
        <h:form id="showGroupForm">
            <p:breadCrumb>  
                <p:menuitem value="#{ml.tr('Home')}" url="#{webContext.baseUrl}" />  
                <p:menuitem value="#{ml.tr('Group list')}" url="#{lm.ml('secure/group/list.xhtml')}" />  
                <p:menuitem value="#{ml.tr('Detail group')}" url="#" />  
            </p:breadCrumb>
            <p:tabView>  
                <p:tab title="#{ml.tr('User roles')}">  
                    <p:dataTable var="role" value="#{secureGroupShow.rolesInGroup}"
                                 paginator="true" rows="#{constants.DATATABLE_ROWS}">

                        <f:facet name="header">
                            #{ml.tr('User roles')}
                        </f:facet>

                        <p:column headerText="#{ml.tr('Name')}">
                            <h:outputText value="#{ml.tr(role.title)}" />
                        </p:column>

                        <p:column headerText="#{ml.tr('Description')}">
                            <h:outputText value="#{ml.tr(role.description)}" />
                        </p:column>
                    </p:dataTable>
                </p:tab>

                <p:tab title="#{ml.tr('List of users')}">

                    <p:dataTable id="userList" var="user" value="#{secureGroupShow.usersInGroup}"
                                 paginator="true" rows="#{constants.DATATABLE_ROWS}">

                        <f:facet name="header">
                            "#{ml.tr('List of users')}"
                        </f:facet>

                        <p:column filterBy="#{user.username}"
                                  headerText="#{ml.tr('Username')}"
                                  filterMatchMode="contains">
                            <h:outputText value="#{user.firstname}" />
                        </p:column>

                        <p:column filterBy="#{user.firstname}"
                                  headerText="#{ml.tr('Name')}"
                                  filterMatchMode="contains">
                            <h:outputText value="#{user.firstname}" />
                        </p:column>

                        <p:column filterBy="#{user.lastname}"
                                  sortBy="#{user.lastname}"
                                  headerText="#{ml.tr('Surname')}"
                                  filterMatchMode="contains">
                            <h:outputText value="#{user.lastname}" />
                        </p:column>

                        <p:column filterBy="#{user.email}"
                                  headerText="#{ml.tr('Email')}"
                                  filterMatchMode="contains">
                            <a href="mailto:#{user.email}">
                                <h:outputText value="#{user.email}" />
                            </a>
                        </p:column>

                        <p:column filterBy="#{user.phone}"
                                  headerText="#{ml.tr('Phone')}"
                                  filterMatchMode="contains">
                            <h:outputText value="#{user.phone}" />
                        </p:column>

                        <p:column filterBy="#{user.city}"
                                  headerText="#{ml.tr('City')}"
                                  filterMatchMode="contains">
                            <h:outputText value="#{user.city}" />
                        </p:column>
                    </p:dataTable>
                </p:tab>
            </p:tabView>
        </h:form>
    </ui:define>
</ui:composition>
